cc.Class({
    extends: require("GameBase"),

    properties: {
        resource1:{
            default : null,
            type : cc.SpriteFrame,
        },
		resource3:{
            default : null,
            type : cc.SpriteFrame,
        },
		resource4:{
            default : null,
            type : cc.SpriteFrame,
        },
		effectMast:{
			default:null,
			type:cc.Node
		},
		effectTop:{
			default:null,
			type:cc.Node
		},
		effectStar:{
			default:null,
			type:cc.Prefab
		},
		effectStarBig:{
			default:null,
			type:cc.Prefab
		},
		effectBoom:{
			default:null,
			type:cc.Prefab
		},
		canvas:{
			default:null,
			type:cc.Node
		},
		messageDisplay: {
            default: null,
            type: cc.Label
        },
		goonDisplay: {
            default: null,
            type: cc.Label
        },
		backDisplay: {
            default: null,
            type: cc.Label
        },
    },
	
    onLoad: function () {
		
		this.initBaseGame(1);
		
    },
	
	goon(){
		if(this.scoreadd>0){
				
				this.score+=this.scoreadd;
				
				if(this.happyTime!=0||this.lastStep>0)
					this.showMessage("+ "+this.scoreadd);
				
				this.scoreadd = 0;
		}
		
		if(this.happyTime==0){
		
			if(this.gameOver()){
			
				this.effectMast.active = true;
			
				this.showMessage("步数用完");
			
			
				this.happyTime=1;
				this.rewardManager.startReward();
				//this.node.runAction(cc.sequence(cc.delayTime(1.4),this.toScoreCallback));
			
				return ;
			
			}else{
			
				if(this.mapManager.canMove(this)){
					this.selectedBlock=null;
					this.selectedBlock2=null;
				}else{
					this.moveAll();
				}
			}
		}else{
			this.rewardManager.disappearDuringReward();
		}
	},
	
});
